<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>测试 VAL_TABLE 修复</title>
</head>
<body>
    <h1>测试 VAL_TABLE 修复</h1>
    <pre id="result"></pre>

    <script src="dbc-parser.js"></script>
    <script>
        const testContent = `VERSION ""

BU_:

VAL_TABLE_ vt_BooleanValues 1 "true" 0 "false" ;

BO_ 100 TestFrame: 8 Vector__XXX
 SG_ TestSignal : 0|8@1+ (1,0) [0|255] "" Vector__XXX`;

        const resultEl = document.getElementById('result');
        
        try {
            console.log('测试内容:', testContent);
            const database = parseDBCContent(testContent, 'test.dbc');
            resultEl.textContent = `成功解析！
帧数量: ${database.frames.length}
警告数量: ${database.warnings.length}
警告信息: ${database.warnings.map(w => w.message).join(', ')}`;
        } catch (error) {
            resultEl.textContent = `解析失败: ${error.message}`;
            console.error('详细错误:', error);
        }
    </script>
</body>
</html> 